/**
 * This is a generated sub-class of _Release.as and is intended for behavior
 * customization.  This class is only generated when there is no file already present
 * at its target location.  Thus custom behavior that you add here will survive regeneration
 * of the super-class. 
 *
 * NOTE: Do not manually modify the RemoteClass mapping unless
 * your server representation of this class has changed and you've 
 * updated your ActionScriptGeneration,RemoteClass annotation on the
 * corresponding entity 
 **/ 
 
package com.gorillalogic.scrummonkey.dms
{
	import mx.collections.ArrayCollection;
	import com.adobe.fiber.core.model_internal;
	
[RemoteClass(alias="ScrumDMS.Release")]   
public class Release extends _Super_Release
{
	/** 
	 * DO NOT MODIFY THIS STATIC INITIALIZER - IT IS NECESSARY
	 * FOR PROPERLY SETTING UP THE REMOTE CLASS ALIAS FOR THIS CLASS
	 *
	 **/
	
	/**
	 * Calling this static function will initialize RemoteClass aliases
	 * for this value object as well as all of the value objects corresponding
	 * to entities associated to this value object's entity.  
	 */     
	public static function _initRemoteClassAlias() : void
	{
		_Super_Release.model_internal::initRemoteClassAliasSingle(com.gorillalogic.scrummonkey.dms.Release);
		_Super_Release.model_internal::initRemoteClassAliasAllRelated();
	}
	
	model_internal static function initRemoteClassAliasSingleChild() : void 
	{
		_Super_Release.model_internal::initRemoteClassAliasSingle(com.gorillalogic.scrummonkey.dms.Release);
	}
	
	{
		_Super_Release.model_internal::initRemoteClassAliasSingle(com.gorillalogic.scrummonkey.dms.Release);
	}
	/** 
	 * END OF DO NOT MODIFY SECTION
	 *
	 **/	
	
	public function Release(name:String=null,description:String=null) {
		super();
		this.name = name;
		this.description = description;
		this.iterations = new ArrayCollection();
		this.objectives = new ArrayCollection();
	}
	
	/**
	 * Add an iteration to this release
	 * @param iteration the iteration to add. If null, a new iteration will be created
	 * @returns the newly added iteration
	 */
	public function addIteration(iteration:Iteration=null):Iteration {
		if (iteration == null) {
			iteration = new Iteration("New Iteration");
		}
		iteration.release = this;
		this.iterations.addItem(iteration);
		return iteration;
	}
	

	public function removeObjective(objective:Objective):void {
		objective.unassign(this);
	}	
	
	public function addObjective(objective:Objective):void {
		objective.assign(this);
	}
}

}